//
//  LBURLConfig.m
//  app
//
//  Created by LINAICAI on 2017/1/10.
//  Copyright © 2017年 NAICAI LI. All rights reserved.
//

#import "LBURLConfig.h"

@interface LBURLConfig ()
@property(nonatomic , assign)LBURLENV_CONFIG_TYPE env;
@property(nonatomic , strong)NSString *homeURL;
@property(nonatomic , strong)NSString *userURL;
@property(nonatomic , strong)NSString *resourceURL;
@property(nonatomic , strong)NSString *projectURL;
@property(nonatomic , strong)NSString *ossURL;
@property(nonatomic , strong)NSString *payURL;
@property(nonatomic , strong)NSString *imURL;
@property(nonatomic , strong)NSString *tenderURL;
@property(nonatomic , strong)NSString *taskURL;
@property(nonatomic , strong)NSString *commonURL;
@property(nonatomic , strong)NSString *reconResourceURL;
@property(nonatomic , strong)NSString *jobURL;
@property(nonatomic , strong)NSString *orderURL;
@property(nonatomic , strong)NSString *beeURL;
@property(nonatomic , strong)NSString *unionNumberURL;
@property(nonatomic , strong)NSString *timURL;
@property(nonatomic , strong)NSString *discussesURL;
@end


@implementation LBURLConfig
+ (instancetype)sharedManager
{
    static __kindof LBURLConfig *sharedInstance = nil;
    static dispatch_once_t predicate;
    dispatch_once(&predicate, ^{
        sharedInstance=[[super allocWithZone:NULL] init];
    });
    return sharedInstance;
}
#warning URL ENV
+ (void)load{
    [super load];
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
#ifdef DEBUG_DEV
        //开发环境
        [LBURLConfig setupWithType:LBURLENV_CONFIG_TYPE_DEV];
        return;
#endif
#if(defined RELEASE_TEST) || (defined DEBUG_TEST)
        //测试环境
        [LBURLConfig setupWithType:LBURLENV_CONFIG_TYPE_TEST];
        return;
#endif

#if(defined RELEASE_UAT) || (defined DEBUG_UAT)
        //UAT环境
        [LBURLConfig setupWithType:LBURLENV_CONFIG_TYPE_UAT];
        return;
#endif

#if(defined RELEASE_PUBLISH) || (defined DEBUG_PUBLISH)
        //生产环境
        [LBURLConfig setupWithType:LBURLENV_CONFIG_TYPE_RELEASE];
        return;
#endif
        //生产环境
        [LBURLConfig setupWithType:LBURLENV_CONFIG_TYPE_RELEASE];
        return;
        
    });


}
+ (void)setupWithType:(LBURLENV_CONFIG_TYPE)type
{
    if (type == LBURLENV_CONFIG_TYPE_TEST) {
        [LBURLConfig sharedManager].homeURL = @"http://113.108.139.178:9590/";
        [LBURLConfig sharedManager].userURL = @"http://113.108.139.178:9190/";
        [LBURLConfig sharedManager].resourceURL = @"http://113.108.139.178:9290/";
        [LBURLConfig sharedManager].projectURL = @"http://113.108.139.178:9690/";
        [LBURLConfig sharedManager].ossURL = @"http://113.108.139.178:9890/";
        [LBURLConfig sharedManager].payURL = @"http://113.108.139.178:29899/";
        [LBURLConfig sharedManager].imURL = @"http://113.108.139.178:9790/";
        [LBURLConfig sharedManager].tenderURL = @"http://113.108.139.178:29956/";
        [LBURLConfig sharedManager].taskURL = @"http://113.108.139.178:28003/";
        [LBURLConfig sharedManager].commonURL = @"http://113.108.139.178:9514/";
        [LBURLConfig sharedManager].reconResourceURL = @"http://113.108.139.178:8014/";
        [LBURLConfig sharedManager].jobURL = @"http://113.108.139.178:28018/";
        [LBURLConfig sharedManager].orderURL = @"http://113.108.139.178:22808/";
        //需要配置小蜜和联结号
        [LBURLConfig sharedManager].beeURL = @"http://113.108.139.178:29201/";
        [LBURLConfig sharedManager].unionNumberURL = @"http://113.108.139.178:29201/";
        [LBURLConfig sharedManager].timURL = @"http://113.108.139.178:29964/";
        [LBURLConfig sharedManager].discussesURL = @"http://113.108.139.178:29968/";
    }
    else if (type == LBURLENV_CONFIG_TYPE_DEV){
        [LBURLConfig sharedManager].homeURL = @"http://113.108.139.178:11803/";
        [LBURLConfig sharedManager].userURL = @"http://113.108.139.178:11808/";
        [LBURLConfig sharedManager].resourceURL = @"http://113.108.139.178:11806/";
        [LBURLConfig sharedManager].projectURL = @"http://113.108.139.178:11805/";
        [LBURLConfig sharedManager].ossURL = @"http://113.108.139.178:11801/";
        [LBURLConfig sharedManager].payURL = @"http://113.108.139.178:11809/";
        [LBURLConfig sharedManager].imURL = @"http://113.108.139.178:11804/";
        [LBURLConfig sharedManager].tenderURL = @"http://113.108.139.178:28114/";
        [LBURLConfig sharedManager].taskURL = @"http://113.108.139.178:8002/";
        [LBURLConfig sharedManager].commonURL = @"http://113.108.139.178:9914/";
        [LBURLConfig sharedManager].reconResourceURL = @"http://113.108.139.178:8006/";
        [LBURLConfig sharedManager].jobURL = @"http://192.168.36.229:8010/";
        [LBURLConfig sharedManager].orderURL = @"http://113.108.139.178:28110/";
        //小蜜和联结号的URL一样的,2017/10/13
        [LBURLConfig sharedManager].beeURL = @"http://113.108.139.178:19201/";
        [LBURLConfig sharedManager].unionNumberURL = @"http://113.108.139.178:19201/";
        [LBURLConfig sharedManager].timURL = @"http://113.108.139.178:28123/";
        [LBURLConfig sharedManager].discussesURL = @"http://113.108.139.178:19956/";
    }
    else if (type == LBURLENV_CONFIG_TYPE_UAT){
        [LBURLConfig sharedManager].homeURL = @"https://uathomeapi.lianj.com/";
        [LBURLConfig sharedManager].userURL = @"https://uatuserapi.lianj.com/";
        [LBURLConfig sharedManager].resourceURL = @"https://uatresourceapi.lianj.com/";
        [LBURLConfig sharedManager].projectURL = @"https://uatprojectapi.lianj.com/";
        [LBURLConfig sharedManager].ossURL = @"https://uatossapi.lianj.com/";
        [LBURLConfig sharedManager].payURL = @"https://uatpaymentapi.lianj.com/";
        [LBURLConfig sharedManager].imURL = @"https://uatimapi.lianj.com/";
        [LBURLConfig sharedManager].tenderURL = @"https://uatocapi.lianj.com/";
        [LBURLConfig sharedManager].taskURL = @"https://uattaskapi.lianj.com/";
        [LBURLConfig sharedManager].commonURL = @"https://uatbaseapi.lianj.com/";
        [LBURLConfig sharedManager].reconResourceURL = @"https://uatresapi.lianj.com/";
        [LBURLConfig sharedManager].jobURL = @"https://uatjobapi.lianj.com/";
        [LBURLConfig sharedManager].orderURL = @"https://uatcoapi.lianj.com/";
        //需要配置小蜜和联结号
        [LBURLConfig sharedManager].beeURL = @"https://uatpartnerapi.lianj.com/";
        [LBURLConfig sharedManager].unionNumberURL = @"https://uatpartnerapi.lianj.com/";
        [LBURLConfig sharedManager].timURL = @"https://uatvideoapi.lianj.com/";
        [LBURLConfig sharedManager].discussesURL = @"https://uatnegotiationapi.lianj.com/";
    }
    else if (type == LBURLENV_CONFIG_TYPE_RELEASE){
        [LBURLConfig sharedManager].homeURL = @"https://homeapi.lianj.com/";
        [LBURLConfig sharedManager].userURL = @"https://userapi.lianj.com/";
        [LBURLConfig sharedManager].resourceURL = @"https://resourceapi.lianj.com/";
        [LBURLConfig sharedManager].projectURL = @"https://projectapi.lianj.com/";
        [LBURLConfig sharedManager].ossURL = @"https://uploadapi.lianj.com/";
        [LBURLConfig sharedManager].payURL = @"https://paymentapi.lianj.com/";
        [LBURLConfig sharedManager].imURL = @"https://imapi.lianj.com/";
        [LBURLConfig sharedManager].tenderURL = @"https://ocapi.lianj.com/";
        [LBURLConfig sharedManager].taskURL = @"https://taskapi.lianj.com/";
        [LBURLConfig sharedManager].commonURL = @"https://baseapi.lianj.com/";
        [LBURLConfig sharedManager].reconResourceURL = @"https://resapi.lianj.com/";
        [LBURLConfig sharedManager].jobURL = @"https://jobapi.lianj.com/";
        [LBURLConfig sharedManager].orderURL = @"https://coapi.lianj.com/";
        //需要配置小蜜和联结号
        [LBURLConfig sharedManager].beeURL = @"https://partnerapi.lianj.com/";
        [LBURLConfig sharedManager].unionNumberURL = @"https://partnerapi.lianj.com/";
        [LBURLConfig sharedManager].timURL = @"https://videoapi.lianj.com/";
        [LBURLConfig sharedManager].discussesURL = @"https://negotiationapi.lianj.com/";
    }
    [LBURLConfig sharedManager].env = type;
}
@end
